<template>
  <LayoutTopBottom :show-header="true">
    <template #header>
      <div class="chat-header">
        <div class="contact-name no-drag">小明</div>

        <div class="operate no-drag">
          <div class="more-info">
            <div class="icon">
              <span class="iconfont icon-gengduo"></span>
            </div>
          </div>
        </div>
      </div>
    </template>

    <!-- 下部分 -->
    <template #body>
      <div class="chat-window"></div>
    </template>

    <!-- 底部 -->
    <template #footer>
      <div class="chat-inpt no-drag">
        <div class="tool-bar">
          <div class="tool-bar-left">
            <div class="tool-icon">
              <span class="iconfont icon-biaoqing"></span>
            </div>
            <div class="tool-icon">
              <span class="iconfont icon-wenjianjia_o"></span>
            </div>
            <div class="tool-icon">
              <span class="iconfont icon-jietu"></span>
            </div>
            <div class="tool-icon">
              <span class="iconfont icon-liaotianjilu"></span>
            </div>
          </div>
          <div class="tool-bar-right">
            <div class="tool-icon">
              <span class="iconfont icon-yuyintonghua"></span>
            </div>
            <div class="tool-icon">
              <span class="iconfont icon-shipintonghua-tianchong"></span>
            </div>
          </div>
        </div>

        <div class="chat-input-textarea">
          <textarea class="custom-textarea"></textarea>
        </div>

        <div class="send-btn">
          <span>发送(S)</span>
        </div>
      </div>
    </template>
  </LayoutTopBottom>
</template>

<script setup lang="ts">
import LayoutTopBottom from "@/components/layout/LayoutTopBottom.vue";
</script>

<style scoped lang="scss">
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f5f5f5;

  .chat-header {
    height: 60px;
    padding: 0px 0 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 25px;

    .contact-name {
      text-align: center;
      font-size: 18px;

      &:hover {
        cursor: pointer;
      }
    }

    .operate {
      display: flex;
      flex-direction: column;
      align-items: center;

      .more-info {
        width: 100%;
        display: flex;
        justify-content: end;
        align-items: center;
        color: #494949;

        .icon {
          width: 33px;
          height: 25px;
          display: flex;
          align-items: center;
          justify-content: center;

          span {
            font-size: 20px;
          }

          &:hover {
            color: #828282;
            cursor: pointer;
          }

          &:active {
            color: #86ddb0;
          }
        }
      }
    }
  }

  .chat-inpt {
    width: 100%;
    height: 100%;
    padding: 0px 20px 20px 20px;
    position: relative;

    .tool-bar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 5px;

      .tool-icon {
        width: 25px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #494949;

        &:hover {
          color: #979797;
          cursor: pointer;
        }

        span {
          font-size: 18px;
        }
      }

      .tool-bar-left {
        display: flex;
        align-items: center;
        justify-content: start;
      }

      .tool-bar-right {
        display: flex;
        align-items: center;
        justify-content: start;
      }
    }

    .chat-input-textarea {
      width: 100%;

      .custom-textarea {
        width: 100%;
        padding: 10px;
        font-size: 16px;
        border: none;
        border-radius: 8px;
        resize: none; /* 禁止调整大小 */
        outline: none; /* 移除聚焦时的边框 */
        background-color: transparent;
      }
    }

    .send-btn {
      position: absolute;
      bottom: 30px;
      right: 30px;
      width: 100px;
      height: 30px;
      background-color: #e9e9e9;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #07c160;
      border-radius: 5px;

      &:hover {
        cursor: pointer;
        background-color: #d2d2d2;
      }
    }
  }
}
</style>
